package com.gzdh.tang.config.leshua;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class LeshuaPayConfig {

    @Value("${leshua.pay.merchantId}")
    private String merchantId;

    @Value("${leshua.pay.agentId}")
    private String agentId;

    @Value("${leshua.pay.key}")
    private String key;

    @Value("${leshua.pay.requestUrl}")
    private String requestUrl;

    @Value("${leshua.useDatabaseConfig}")
    private Boolean useDatabaseConfig;

    @Bean
    public void initLsUtils(){
        LeshuaPayUtils.setMerchantId(merchantId);
        LeshuaPayUtils.setAgentId(agentId);
        LeshuaPayUtils.setKey(key);
        LeshuaPayUtils.setRequestUrl(requestUrl);
        LeshuaPayUtils.setUseDatabaseConfig(useDatabaseConfig);
    }
}
